package gcu.module.room.dao.mapper;

import gcu.module.room.daomain.Room;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Created by haol on 2016/9/26.
 */
@Repository
public interface RoomMapper {

      /*增加楼宇*/
      void addRoom(@Param("room") Room room);

      /*增加楼宇*/
      void setRoomIsIn(@Param("id") int id,@Param("isOrNot")int isOrNot,@Param("ownerId")Integer ownerId);

      /*增加楼宇*/
      void deleteRoom(@Param("id") int id);

      /*增加楼宇*/
      void deleteRoomByList(@Param("list") List list);

      /*增加楼宇*/
      void deleteRoomByBuild(@Param("buildName") String buildName);

      /*更新楼宇*/
      void updateRoom(@Param("room") Room room);

      /*通过id查看楼宇*/
      Room queryRoomById(@Param("id") int id);

      /*通过id查看楼宇*/
      Room queryRoomByNameAndBuildName(@Param("buildName") String buildName,@Param("roomNum")String roomNum);

      /*分页查找楼宇*/
      List<Room> query(@Param("room") Room room, @Param("skip") int skip, @Param("size") int size);

      /*按需统计全部*/
      long count(@Param("room") Room room);
}
